package com.briup.app01.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.briup.app01.bean.SysRole;
import com.briup.app01.bean.SysRoleExample;
import com.briup.app01.bean.SysRoleExample.Criteria;
import com.briup.app01.dao.SysRoleMapper;
import com.briup.app01.service.SysRoleService;
@Service
public class SysRoleServiceImpl implements SysRoleService {
	@Autowired
	private SysRoleMapper roleMapper;
	public void saveOrUpdate(SysRole role) {
		if(role.getRoleId()==null) {
			roleMapper.insertSelective(role);
		}else {
			roleMapper.updateByPrimaryKey(role);
	     }
	}
	public void deleteById(long id) {
		roleMapper.deleteByPrimaryKey(id);
	}
	public SysRole selectById(long id) {
		return roleMapper.selectByPrimaryKey(id);
	}
	
	public List<SysRole> select(long name, String dexc,String flag) {
		SysRoleExample example = new SysRoleExample();
/*    	Criteria criteria = example.createCriteria();
    	if(type!=null) {
    		criteria.andSvrTypeLike("%"+type+"%");
    	}
    	if(title!=null) {
    		criteria.andSvrTitleLike("%"+title+"%");
    }
    	if(status!=null) {
    		criteria.andSvrStatusLike("%"+status+"%");
    	}*/
    		return roleMapper.selectByExample(example);
	}
	public List<SysRole> select(String name, String desc, long flag) {
		// TODO Auto-generated method stub
		return null;
	}
	
	}
	
	
	
	
	